﻿@model PaymentHelper.PaymentFlow.ModelTemplate.RouteModel
@using PaymentHelper.PaymentFlowTemplates.Default.Models;  

@{
    ViewBag.Title = ViewBag.Resources["DefaultPaymentFlow.PaymentInfoTitle"];

    if (!string.IsNullOrEmpty(PaymentHelper.PaymentFlow.PaymentFlowManager.Layout))
    {
        Layout = PaymentHelper.PaymentFlow.PaymentFlowManager.Layout;
    }
    
    var listError = HttpContext.Current.Session["PaymentInfoError"];
}

<div class="@ViewBag.CssClass">
    
    @Html.Action("PaymentSteps","DefaultTemplate", new { step = PaymentStep.PaymentInfo })

    @using (Html.BeginForm("PaymentInfo", "DefaultTemplate", FormMethod.Post, new { id = "phFrm_paymentinfo", autocomplete = "off" }))
    {
        <div class="payment">
            <fieldset>
                <legend>@ViewBag.Resources["DefaultPaymentFlow.PaymentInfo"]</legend>

                @{ Html.RenderAction(Model.Action, Model.Controller, Model.RoutePaymentInfo); }

            </fieldset>
            
            @if (listError != null)
            {
                <div class="ph_error">
                    <ul>
                        @foreach (var error in (List<string>)listError)
                        {
                            <li>@error</li>
                        }
                    </ul>
                </div>
            }
            
            @if (ViewBag.ShowCart)
            {
                @Html.Action("ShowCart", "DefaultTemplate");
            }   

        </div>          
        <div class="btn_control">
            <p style="text-align: center;">
                <input type="button" value="@ViewBag.Resources["DefaultPaymentFlow.Cancle"]" onclick="location.href='@Url.RouteUrl("DefaultTemplate.Cancle")'" class="btn_ph_payment"/>
                <input type="submit" name="ph_nextstep" value="@ViewBag.Resources["DefaultPaymentFlow.NextStep"]" class="btn_ph_payment"/>
            </p>
        </div>
    
    }

    <script type="text/javascript">
        
    </script>

</div>
